 window.onload = function() {
            var coordinates = ToolMan.coordinates();
	        var drag = ToolMan.drag();
	        
            var loginForm = document.getElementById("loginForm");
	        drag.createSimpleGroup(loginForm);
	        
	        var divMedia = document.getElementById("divMedia");
	        drag.createSimpleGroup(divMedia);
	        
	        var divFlash = document.getElementById("divFlash");
	        drag.createSimpleGroup(divFlash);
	        
        }
        function ImgResize(imgPath,thumbSize){
        
            document.getElementById("loginForm").style.top = "100px";
            document.getElementById("loginForm").style.left = "100px";
            document.getElementById("loginForm").style.visibility = "visible";
            document.getElementById("fPic").src = imgPath;
            
            var newImg=new Image();
            newImg.src=imgPath;
            var _width=newImg.width;
            var _height=newImg.height;
            
            if(_width>thumbSize)
            {
                _height=Math.round(_height*thumbSize/_width);
                _width=thumbSize;
            }
            else if(_height>thumbSize)
            {
                _width=Math.round(_width*thumbSize/_height);
                _height=thumbSize;
            }
            
            if(_width == 0 || _height == 0)
            {
                 newImg.src=imgPath;
                _width=newImg.width;
                _height=newImg.height;
            }
            
            var currImg=document.getElementById("fPic");
            currImg.src=newImg.src;
            currImg.width=_width;
            currImg.height=_height;
        }
        
        function CloseFormImage(){
            document.getElementById("fPic").src = "";
            document.getElementById("loginForm").style.visibility = "hidden";
        }
        
        function playMedia(mediaPath){
        
            document.getElementById("divMedia").style.top = "100px";
            document.getElementById("divMedia").style.left = "100px";
            document.getElementById("divMedia").style.visibility = "visible";
            mediaPlayer = document.getElementById("mediaPlayer");
            mediaPlayer.fileName = mediaPath;
            mediaPlayer.play();
        }
        
        function CloseFormMedia(){
            mediaPlayer.stop();
            document.getElementById("divMedia").style.visibility = "hidden";
        }
        
              
        function playFlash(flashPath){
            
            document.getElementById("divFlash").style.top = "100px";
            document.getElementById("divFlash").style.left = "100px";
            document.getElementById("divFlash").style.visibility = "visible";
            var so = new SWFObject(flashPath, "sotester", "300", "300", "9");
            so.write("flashcontent");
        }
        
        function CloseFormFlash(){
            document.getElementById("flashcontent").innerHTML = "";
            document.getElementById("divFlash").style.visibility = "hidden";
        }
